import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';

import {HomeComponent} from './view-root/home/home.component';
import {RouterModule, Routes} from '@angular/router';

import {SystemInformationComponent} from './vs/system-information/system-information.component';
import {DeviceSettingComponent} from './vs/device-setting/device-setting.component';
import {BedSensorSettingsComponent} from './vs/bed-sensor-settings/bed-sensor-settings.component';
import {CalibrationComponent} from './vs/bed-sensor-settings/calibration/calibration.component';
import {AdvancedSettingsComponent} from './vs/bed-sensor-settings/advanced-settings/advanced-settings.component';
import {DataCommunicationComponent} from './vs/device-setting/data-communication/data-communication.component';
import {AuthenticationComponent} from './vs/device-setting/authentication/authentication.component';
import {NetworkComponent} from './vs/device-setting/network/network.component';
import {FirmwareUpgradeComponent} from './vs/device-setting/firmware-upgrade/firmware-upgrade.component';
import {MonitoringComponent} from "./vs/monitoring/monitoring.component";
import {MotionStatusComponent} from "./vs/monitoring/motion-status/motion-status.component";
import {HeartRateComponent} from "./vs/monitoring/heart-rate/heart-rate.component";
import {HeartRateVariabilityComponent} from "./vs/monitoring/heart-rate-variability/heart-rate-variability.component";
import {RespirationRateComponent} from "./vs/monitoring/respiration-rate/respiration-rate.component";
import {StrokeVolumeComponent} from "./vs/monitoring/stroke-volume/stroke-volume.component";
import {AlertNotificationComponent} from "./vs/alert-notification/alert-notification.component";
import {ServiceComponent} from "./vs/alert-notification/service/service.component";
import {ReceiversComponent} from "./vs/alert-notification/receivers/receivers.component";

const appRoutes: Routes = [
    {
        path: 'home',
        component: HomeComponent,
        // canActivate: [AuthGuard],
        children: [
            {path: '', redirectTo: 'system-information', pathMatch: 'full'},
            {
                path: 'system-information',
                component: SystemInformationComponent,
            },
            {
                path: 'monitoring',
                children: [
                    {path: '', component: MonitoringComponent},
                    {
                        path: 'motion-status',
                        component: MotionStatusComponent,
                    },
                    {
                        path: 'heart-rate',
                        component: HeartRateComponent,
                    },
                    {
                        path: 'heart-rate-variability',
                        component: HeartRateVariabilityComponent,
                    },
                    {
                        path: 'respiration-rate',
                        component: RespirationRateComponent,
                    },
                    {
                        path: 'stroke-volume',
                        component: StrokeVolumeComponent,
                    },
                ]
            },
            {
                path: 'alert-notification',
                children: [
                    {path: '', component: AlertNotificationComponent},
                    {
                        path: 'service',
                        component: ServiceComponent,
                    },
                    {
                        path: 'receivers',
                        component: ReceiversComponent,
                    },
                ]
            },
            {
                path: 'device-settings',
                children: [
                    {path: '', component: DeviceSettingComponent},
                    {
                        path: 'data-communication',
                        component: DataCommunicationComponent,
                        // canActivate: [AuthGuard],
                    },
                    {
                        path: 'authentication',
                        component: AuthenticationComponent,
                        // canActivate: [AuthGuard],
                    },
                    {
                        path: 'network',
                        component: NetworkComponent,
                        // canActivate: [AuthGuard],
                    },
                    {
                        path: 'firmware-upgrade',
                        component: FirmwareUpgradeComponent,
                        // canActivate: [AuthGuard],
                    },

                    /*{
                        path: 'bed-sensor-settings',
                        children: [
                            {path: '', component: BedSensorSettingsComponent},
                            {
                                path: 'calibration',
                                component: CalibrationComponent,
                            },
                            {
                                path: 'advanced-settings',
                                component: AdvancedSettingsComponent,
                            },
                        ]
                    },*/
                ]
            },
        ]
    },
    {path: '', redirectTo: 'home', pathMatch: 'full'}
];

@NgModule({
    declarations: [],
    imports: [
        CommonModule,
        RouterModule.forRoot(appRoutes)
    ],
    exports: [RouterModule],
})
export class AppRoutingModule {
}
